<%@page import="com.xxb.entity.CartItem"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.xxb.entity.User"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>加入购物车</title>
		<link href="style/cartcss.css" rel="stylesheet" type="text/css"/>
	</head>
	<body>
		<div id="header">
			<div class="logo"></div>
			<div class="login"> 
                <%
					User user = (User)session.getAttribute("curruser");
				 	if(user == null){
				 %> 
				<a href="main.jsp">您好，欢迎观临达芙妮官方购物网</a>&nbsp;&nbsp; 
           		<a href="l_to_login.jsp" >登陆</a> 
                |
				<a href="l_to_reg.jsp" >注册</a>
           		<%}else{ %>
           		<a href="main.jsp">您好，<%=user.getName() %></a>&nbsp;&nbsp;
           		<a href="l_exit.jsp" >退出</a> 
                |
				<a href="l_member.jsp" >会员管理平台</a>
           		<%} %>
			</div>
			<div class="menu">
				<ul>
                    <li class="a" style="width:111px;"><a href="main.jsp">首页</a></li>
                    <li class="b" style="width:95px;"><a href="#">新品</a></li>
                    <li class="c" style="width:119px;"><a href="#">凉鞋</a></li>
                    <li class="d" style="width:95px;"><a href="danxie.jsp">单鞋</a></li>
                    <li class="e" style="width:95px;"><a href="#">靴子</a></li>
                    <li class="f" style="width:119px;"><a href="#">包.饰品</a></li>
                    <li class="g" style="width:119px;"><a href="#">特价专区</a></li>
				</ul>
				<div class="cart">
                        购物车（1）
					<a href="cart.jsp" style="text-decoration:none"><input type="button" value="去结算" style="cursor:pointer"/></a>
				</div>
			</div>
			<div class="search">
				<div class="hottag" style="margin-top:0px;margin-bottom:0px;width:480px;">
                    热门分类：&nbsp;
                    <a href="#">单鞋</a>&nbsp;|&nbsp;
                    <a href="#">高跟鞋</a>&nbsp;|&nbsp;
                    <a href="#">鱼嘴</a>&nbsp;|&nbsp;
                    <a href="#">平底</a>&nbsp;|&nbsp;
                    <a href="#">坡跟</a>&nbsp;|&nbsp;
                    <a href="#">真皮</a>
				</div>     
				<div class="searchinput">
                    <input type="text" class="search-area"/>
                    <input type="button" class="search-button"/>
				</div>	
			</div>
		</div>		
		<div id="content">
			<div class="current">
			当前位置：
			<a href="main.jsp">首页</a>>购物车
			</div>
			<div class="pic">
				<p class="step2">1.加入购物车》2.编辑订单》3.确认订单》4.订单成功</p>
				<p class="explain">如果您修改了商品数量，请点击
					<img src="images/save_bg_gray.gif" class="save"/>
				</p>
			</div>
			<div id="cartbox">
				<table>
					
					<tr id="c1">
						<th>缩略图</th>
						<th style="width:375px;height:18px">商品名</th>
						<th style="width:110px;height:18px;">货号</th>
						<th style="width:50px">尺码</th>
						<th style="width:50px">颜色</th>
						<th style="width:70px">单价</th>
						<th style="width:50px">数量</th>
						<th style="width:110px">小计</th>
						<th style="width:9px">操作</th>
					</tr>
					<%
						List<CartItem> shopcar = (List<CartItem>)session.getAttribute("shopcar"); 
					 		float total = 0f;
					 		for(CartItem item : shopcar){
					 		 
					 			if(item != null){
					 				total += item.getTotal(); 
					 %>						
					<tr id="c2">
						<td>
							<img class="shoes"src="images/<%=item.getProduct().getPic() %>"/>
						</td>
						<td><%=item.getProduct().getProductname() %></td>
						<td><%=item.getProduct().getCode() %></td>
						<td><%=item.getProduct().getSize() %></td>
						<td><%=item.getProduct().getColor() %></td>
						<td class="price" ><%=item.getProduct().getPrice() %></td>
						<td class="num" ><input value="<%=item.getNum()%>" type="text" style="margin:0 0;border: 1px solid #A8A8A8;width:48px;width: 30px;"/>
							<a href="#">
							<img src="images/save_bg_gray.gif" class="save"/>
							</a>
						</td>
						<td class="price" ><%=total%></td>
						<td>
							<a href="l_deletecartItem.jsp?id=<%=item.getProduct().getId() %>" title="删除"><img src="images/cross.png"  /></a>
						</td>
					</tr>
					<%}} %>
					<!--<tr id="c3">
						<td>
							<img class="shoes" style="height:90px;width:90px" src="images/11e300415.jpg"/>
						</td>
						<td>达芙妮魅力优雅－真皮镂空扣饰高跟凉鞋</td>
						<td>11E300415</td>
						<td>35</td>
						<td>黑色</td>
						<td class="price" >299.00</td>
						<td class="num" ><input type="text" style="margin:0 0;border: 1px solid #A8A8A8;width:48px;"/>
							<a href="#">
							<img src="images/save_bg_gray.gif" class="save"/>
							</a>
						</td>
						<td class="price" >299.00</td>
						<td></td>
					</tr>-->
				</table>
				<p class="price">合计：<%=total %>元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
				<a href="main.jsp"><input id="button1" type="button" style="width:113px;height:45px;border:0 none;margin-top:40px"/></a>			
				<a href="#"><input id="button3" type="button" style="width:113px;height:45px;border:0 none;margin-top:40px"/></a>
				<a href="l_to_orderedit.jsp"><input id="button2" type="button" style="width:113px;height:45px;border:0 none;margin-top:40px"/></a>
			</div>
		</div>
		<div class="footer">
			<img src="images/tel.jpg" style="float:right"/><br/>
			<img src="images/footer.PNG" style="margin-top:10px;"/>
			<div class="footerf">
				<img src="images/foot-logo.jpg" style="float:right"/>	
			</div>
			<div style="margin-top:27px;float:right">
				<img src="images/oo.PNG" style="float:right"/>
			</div>
		</div>
	</body>
</html>